package com.example.spring0909.section4.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.example.spring0909.section4.service.StudentInfo20Service;

import javax.annotation.Resource;

/**
 * 200720班同学基本信息(StudentInfo20)表控制层
 *
 * @author 
 * @since 2022-04-14 10:47:11
 */
@Controller
@RequestMapping("/studentInfo20")
public class StudentInfo20Controller {
    /**
     * 服务对象
     */
    @Resource(name = "studentInfo20Service")
    private StudentInfo20Service studentInfo20Service;


    @RequestMapping("/queryCount")
    @ResponseBody
    public int queryCount(){
        return studentInfo20Service.queryCount();
    }

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @RequestMapping("/queryById")
    public String  queryById(@RequestParam(value = "studentId",required = false) String id,
                             @RequestParam(value = "chineseName",required = false) String chineseName,
                             Model model) {
        model.addAttribute("student",studentInfo20Service.queryById(id));
        return "studentInfo20";
    }






}

